-module(kitchen).
-compile(export_all).

fridge()->
	fridge1([]).

fridge1(FoodList)->
	receive
		{From,{store,Food}}->
			From!{self(),ok},
			fridge1([Food|FoodList]);
		{From,{take,Food}}->
			case lists:member(Food,FoodList) of
				true ->
					{From! {self,{ok,food}}},
					fridge1(lists:delete(Food,FoodList));
				false ->
					{From! {self,{not_found}}},
					fridge1(FoodList)
			end;
		terminate ->
			ok
	end.

					
